const path = require( 'path' )
module.exports = {
    mode: 'none',
    entry: './src/main.js',
    output: {
        filename: 'bundle.js',
        path: path.join( __dirname, 'dist' )
    },
    module: {
        rules: [
            {
                test: /.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                test: /.html$/,
                use: {
                    loader: 'html-loader',
                    options: {
                        // attrs:['img:src','a:href'] --这样会报错
                        // sources: {
                        //     list: [
                        //         '...', { tag: 'img', attribute: 'data-src', type: 'src' }, { tag: 'a', attribute: 'data-src', type: 'href' }
                        //     ]
                        // }
                        sources:true
                        }
                }
            }
        ]
    }
}